package com.fei.service;

import com.fei.bean.VideoBean;
import com.fei.mapper.VideoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class VideoServiceImpl implements VideoService{

    @Autowired
    VideoMapper videoMapper;

    @Override
    public List<VideoBean> selectOneSignerIdAllVideoService(int singer_id) {
        return videoMapper.selectOneSignerIdAllVideo(singer_id);
    }

    @Override
    public List<VideoBean> selectVideoThreeService() {
        return videoMapper.selectVideoThree();
    }


    @Override
    public List<VideoBean> excludeThreeFindAllService() {
        //查询视频的个数
        Integer num = videoMapper.selectVideoCount();
        if (num > 3){
            return videoMapper.excludeThreeFindAll(num);
        }
        return null;
    }

    @Override
    public VideoBean selectOneIdVideoAndCommentService(Integer id) {
        return videoMapper.selectOneIdVideoAndComment(id);
    }

    @Override
    public List<VideoBean> excludeSelectOneIdVideoFiveService(Integer id) {
        return videoMapper.excludeSelectOneIdVideoFive(id);
    }


}
